package com.example.health_life.dto;

import com.example.health_life.dao.Order; 
import java.math.BigDecimal;
import java.time.Instant;
import java.util.List;

public class OrderWithItemsDTO {
    private Integer id;
    private Integer userId;
    // private String postalCode; 
    private BigDecimal totalPrice;
    // private String address; 
    private Byte status;
    private Instant createTime;
    // private Instant payTime; 
    // private Instant shipTime;
    // private Instant completeTime;
    private List<OrderItemDetailDTO> items;

    public OrderWithItemsDTO() {
    }

    // Constructor to map from Order entity and a list of item DTOs
    public OrderWithItemsDTO(Order order, List<OrderItemDetailDTO> items) {
        this.id = order.getId();
        this.userId = order.getUserId();
        // this.postalCode = order.getPostalCode();
        this.totalPrice = order.getTotalPrice();
        // this.address = order.getAddress();
        this.status = order.getStatus();
        this.createTime = order.getCreateTime();
        // this.payTime = order.getPayTime();
        // this.shipTime = order.getShipTime();
        // this.completeTime = order.getCompleteTime();
        this.items = items;
    }

    // Getters and Setters
    public Integer getId() { return id; }
    public void setId(Integer id) { this.id = id; }
    public Integer getUserId() { return userId; }
    public void setUserId(Integer userId) { this.userId = userId; }
    public BigDecimal getTotalPrice() { return totalPrice; }
    public void setTotalPrice(BigDecimal totalPrice) { this.totalPrice = totalPrice; }
    public Byte getStatus() { return status; }
    public void setStatus(Byte status) { this.status = status; }
    public Instant getCreateTime() { return createTime; }
    public void setCreateTime(Instant createTime) { this.createTime = createTime; }
    public List<OrderItemDetailDTO> getItems() { return items; }
    public void setItems(List<OrderItemDetailDTO> items) { this.items = items; }
} 